public class MinHeap<E extends Comparable<E>> {

    private Array<E> data;

    public MinHeap() {
        this(10);
    }

    public MinHeap(int capacity) {
        data = new Array<>(capacity);
    }

    public int parent(int index) {
        if (index == 0) throw new IllegalArgumentException("MinHeap doesn't have parent");
        return (index - 1) / 2;
    }

    public int left(int index) { return index * 2 + 1; }
    public int right(int index) { return index * 2 + 2; }

    // TODO 最小堆实现
    public void add(E elem) {

    }

    private void siftUp(int k) {

    }

    public E findMin() {
        return null;
    }

    public E extractMin() {
        return null;
    }

    private void siftDown(int k) {

    }
}
